
mw_cash_path = g4_path + "/plugin/cybercash";

function point_to_cash() {
    win_open(mw_cash_path + "/point-to-cash.php", "point_to_cash", "width=500,height=400,scrollbars=yes");
}

function cash_to_point() {
    win_open(mw_cash_path + "/cash-to-point.php", "cash_to_point", "width=500,height=400,scrollbars=yes");
}

function cash_charge(paytype) {
    win_open(mw_cash_path + "/cash-charge.php?paytype="+paytype, "cash_charge", "width=500,height=600,scrollbars=yes");
}

function cash_membership_charge(paytype) {
    //location.href = "cash-charge.php?membership=1&paytype="+paytype;
    fwrite.paytype.value = paytype;
    fwrite.submit();
}

function buy_contents(bo_table, wr_id, no) {
    win_open(mw_cash_path + "/buy-contents.php?bo_table=" + bo_table + "&wr_id=" + wr_id + "&no=" + no, "buy_contents", "width=550,height=400,scrollbars=yes");
}

function buy_membership(bo_table, win, ms_id) {
    if (ms_id)
        ms_id = "&ms_id=" + ms_id;
    else
        ms_id = "";

    if (win)
        location.href = mw_cash_path + "/buy-membership.php?bo_table=" + bo_table + ms_id;
    else {
        win_membership = window.open(mw_cash_path + "/buy-membership.php?bo_table=" + bo_table + ms_id, "buy_membership", "width=550,height=400,scrollbars=yes");
        win_membership.focus();
    }

    return win_membership;
}

